package xkp.lesson5;

import xkp.lesson4.Person;

public class Box2 <T>{
	private T data;
	
	/**
	 * 泛型方法可以完全不依赖泛型类
	 * @param <K>
	 * @param k
	 */
	public <K> void fun(K k) {
		System.out.println(k.toString());
	}
	
	public static void main(String[] args) {
		Box2 box2 = new Box2();
		//在调用泛型方法时要单独给泛型方法指定类型
		box2.<Person>fun(new Person());
	}
}
